<?php
accessPage(4);
my_component_load('testing' , false);
my_component_load('paging' , false);
my_component_load('ptk');
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$jabatan_id = isset( $_GET['jabatan_id'] ) ? $_GET['jabatan_id']:  0;
$modulname = "Penempatan _BN_ HR Planning _BN_ PTK";
if($_SERVER['REQUEST_METHOD'] == "POST" ):  
	$validatepost = form_validate($id);
	if($validatepost){
		$pagename = $modulname."_BN_ Tambah Data"; 	
		$errors = message_multi_error($validatepost);
		$content = $errors;
		$content .= form_ptk_create($id);
	}else{
		submit_ptk_create( $id ); 
		my_direct('index.php?com=ptk');		
	 }
else: 	
	if($task == 'edit'){
		$pagename = $modulname."_BN_ Tambah Data"; 
		$content = form_ptk_create($id);
	}elseif($task=='delete'){
		delete_ptk($id);
		my_direct('index.php?com=ptk');
	}else{
		$pagename = $modulname;
		load_facebox_script();
		$content = ptk_list();
	}
endif; 
generate_my_web($content, $pagename  );
?>